package com.lancer.cloud.engine.handle;

import com.lancer.cloud.engine.context.RuleCheckContextService;
import com.lancer.cloud.engine.context.core.EngineTask;
import com.lancer.cloud.engine.context.vo.RuleCheckContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

/**
 * 上下文检查处理类
 *
 * @author caijinbang
 * @date 2019-06-22 18:06
 */
@Slf4j
@Service
public class CheckContextHandleService {


    @Autowired
    @Qualifier("commonCheckContextService")
    private RuleCheckContextService commonCheckContextService;

    public RuleCheckContext execute(EngineTask task) {
        RuleCheckContext context = new RuleCheckContext();
        //通用规则检查
        commonCheckContextService.initContext(context);
        //TODO 一系列的业务上下文初始化

        return context;
    }

}
